package org.example.Day8;

import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.OutputStream;

public class CopyTest {
    public static void main(String[] args) throws Exception{
        //创建字节输入流管道
        InputStream is =new FileInputStream("D:/AAAA暑期实训/level2/src/123.jpg");
        //输出流管道
        OutputStream os = new FileOutputStream("C:/app");
        System.out.println(10 / 0);
        //字节数组
        byte[] buffer = new byte[1024]; //1KB
        //从输入流到输出流
        int len;
        while((len = is.read(buffer))!=-1){
            os.write(buffer,0,len);
        }
        os.close();
        is.close();
        System.out.println("复制成功");
    }
}
